@echo off

REM -- Check whether ENVIRONMENT VARIABLES is empty before processing.
if "%PROJECT_PATH%" == "" (
echo No set "PROJECT_PATH" enviroment variables!
echo Stop building and deploying Maven project.
EXIT /B 0
)
if "%PROJECT_NAME%" == "" (
echo No set "PROJECT_NAME" enviroment variables!
echo Stop building and deploying Maven project.
EXIT /B 0
)
if "%EXT%" == "" (
echo No set "EXT" enviroment variables!
echo Stop building and deploying Maven project.
EXIT /B 0
)

REM -- Build maven source code.
cd %PROJECT_PATH%
del /Q target
call mvn clean
call mvn package install -Dmaven.test.skip=true